#!/bin/sh

dt=`date -d "-1 days" +%Y%m%d`
if [ $# == 1 ] ; then
    dt=$1
fi

# raw
hive --hivevar RUNDATE=${dt}  -f src/raw_hism_host_zzdetail.q
hive --hivevar RUNDATE=${dt}  -f src/raw_hism_host_list.q

# ods/dim
hive --hivevar RUNDATE=${dt} -f src/dim_hism_host_list.q
hive --hivevar RUNDATE=${dt} -f src/dim_hism_price_list.q
hive --hivevar RUNDATE=${dt} -f src/ods_hism_host_zzdetail.q

# dwd
hive --hivevar RUNDATE=${dt} -f src/dwd_hism_host_zzdetail.q

# dws
hive --hivevar RUNDATE=${dt} -f src/dws_hism_host_zzdetail.q

# app
hive --hivevar RUNDATE=${dt} -f src/app_hism_host_cost_report.q
hive --hivevar RUNDATE=${dt} -f src/app_hism_host_used_report.q
